<div class="r0 p20 pt10 col-xs-12" ng-controller="backInterfaceCtrl">
<div class="col-xs-6 f16 fb p0 mb5" ng-if="$stateParams.moduleId!='0'&& $stateParams.moduleId!='privateModule'">模块&接口管理-【{{$stateParams.moduleName}}】</div>
<div class="col-xs-6 f16 fb p0 mb5" ng-if="$stateParams.moduleId=='0'|| $stateParams.moduleId=='privateModule'">项目管理-【{{$stateParams.moduleName}}】</div>
<div class="col-xs-6 f14 p0 mb5 tr">
	<a type="button" class="btn btn-primary btn-sm" id="refresh" ng-click="getData(list.page.currentPage)"> <i class="iconfont fb">&#xe611;&nbsp;</i>刷新</a>
	<a type="button" class="btn btn-purple btn-sm" onclick="history.back(-1);"> <i class="iconfont fb">&#xe605;&nbsp;</i>后退</a>
</div>
<div class="col-xs-12 bb1 bt1 pt15 p0 pb10">
		<button type="button" class="ml5 mt1 btn btn-success btn-sm fr" ng-click="getData(1);">
			<i class="iconfont">&#xe610;</i>&nbsp;查询
		</button>
		<div class="form-group w200 fr">
			<label class="sr-only" for="">名称</label>
			<div class="input-group">
				<div class="input-group-addon">名称</div>
				<input type="text" class="form-control input-xs dis-in-blo w120"
					placeholder="名称" id="interfaceName">
			</div>
		</div>
		<div class="form-group w300 fr mr10">
			<label class="sr-only" for="">URL</label>
			<div class="input-group">
				<div class="input-group-addon">URL</div>
				<input type="text" class="form-control input-xs dis-in-blo w120"
					placeholder="URL" id="url">
			</div>
		</div>
		<div class="cb"></div>
</div>
<div class="col-xs-12 mt20 p0 mb10 f14 tr">
	<span class="f12 C999" ng-if="!showOperation('INTERFACE',$stateParams.moduleId) && !showOperation('MODULE',$stateParams.moduleId)">
		*权限不足，若为新增模块，请刷新页面
	</span>
	<a type="button" class="btn btn-success btn-sm cursor" ng-if="showOperation('INTERFACE',$stateParams.moduleId) && $stateParams.moduleId!='0'&& $stateParams.moduleId!='privateModule'"
		ng-click="detail('新增接口',1100,'back/interface/detail.do?id=NULL','&moduleId='+$stateParams.moduleId,initEditInterFace)"> 
		<i class="iconfont fb">&#xe604;</i>&nbsp;新增接口 
	</a>
	<a type="button" class="btn btn-success btn-sm cursor" ng-if="showOperation('MODULE',$stateParams.moduleId)"
		ng-click="detail('新增',700,'module/detail.do?id=NULL','&parentId='+$stateParams.moduleId,initEditInterFace)"> 
		<i class="iconfont fb">&#xe604;</i>&nbsp;
		<!-- 一级模块显示为项目，其他均为模块 -->
		<span ng-if="$stateParams.moduleId=='0'|| $stateParams.moduleId=='privateModule'">新增项目</span>
		<span ng-if="$stateParams.moduleId!='0'&& $stateParams.moduleId!='privateModule'">新增模块</span>
	</a>
</div>

<div class="col-xs-3 f16 fb pl0 mb10 pb5 mt20" ng-if="list.modules.length>0">
	<!-- 一级模块显示为项目，其他均为模块 -->
	<span ng-if="$stateParams.moduleId!='0'&& $stateParams.moduleId!='privateModule'">模块列表</span>
	<span ng-if="$stateParams.moduleId=='0'|| $stateParams.moduleId=='privateModule'">项目列表</span>
</div>
<div class="col-xs-12 p0" ng-if="list.modules.length>0">
	<table class="table table-bordered table-hover">
		<thead>
			<tr class="BGEEE">
				<th class="tc">名称</th>
				<th class="tc">Url前缀</th>
				<td class="tc">类型</td>
				<td class="tc">排序</td>
				<th class="w300 tc">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="item in list.modules">
				<td class="tc">{{item.name}}</td>
				<td class="tc">{{item.url}}</td>
				<td class="tc">{{item.statusName}}</td>
				<td class="tc">{{item.sequence}}</td>
				<td class="tc w400">
				<a class="f12 text-primary mr10 cursor" ng-if="showOperation('MODULE',$stateParams.moduleId)"
					ng-click="detail('编辑【'+item.name+'】',700,'module/detail.do?id='+item.id,initEditInterFace)"
					data-toggle="tooltip" data-placement="top"
					data-original-title="编辑"> <i class="iconfont f12">&#xe618;修改</i>
				</a>
				<a class="f12 text-primary mr10 cursor" ng-href="#/back/interface/list/{{item.id}}/{{item.name}}"> 
					<i class="iconfont f12">&#xe60f;查看接口</i>
				</a>
				<a class="f12 text-danger mr10 cursor" title="删除" ng-if="showOperation('MODULE',$stateParams.moduleId)"
					ng-click="del('module/delete.do?id='+item.id,item.name)">
					<i class="iconfont f12">&#xe60e;删除</i>
				</a>
				<a class="f12 text-primary mr10 cursor" ng-href="project.do#/{{item.projectId}}/interface/list/{{item.id}}/" target="_blank"
				ng-if="$stateParams.moduleId=='0'|| $stateParams.moduleId=='privateModule'"> 
					<i class="iconfont f12 adorn-color">&#xe613;模块主页</i>
				</a>
				<div class="w50 fr tl">
					<a class="f12 text-danger mr10 cursor" title="向上移" ng-click="changeSequence('module',item.id,list.modules[$index-1].id)" ng-if="$index>0">
						<i class="iconfont f12">&#xe623;</i>
					</a>
					<a class="f12 text-danger mr10 cursor" title="向下移" ng-click="changeSequence('module',item.id,list.modules[$index+1].id)" ng-if="$index<list.modules.length-1">
						<i class="iconfont f12">&#xe624;</i>
					</a>
				</div>
				</td>
			</tr>
		</tbody>
	</table>
</div>
<div class="col-xs-3 f16 fb pl0 mb10 pb5 mt20" ng-if="list.interfaces.length>0">接口列表</div>
<div class="col-xs-12 p0" ng-if="list.interfaces.length>0">
	<table class="table table-bordered table-hover">
		<thead>
			<tr class="BGEEE">
				<th class="tc">名称</th>
				<th class="tc">版本号</th>
				<th class="tc">模块名</th>
				<th class="tc">排序</th>
				<th class="tc">最后修改人</th>
				<th class="tc">最后修改时间</th>
				<th class="w300 tc">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr ng-repeat="item in list.interfaces">
				<td class="tc w200">{{item.interfaceName}}</td>
				<td class="tc">{{item.version}}</td>
				<td class="tc">{{item.moduleName}}</td>
				<td class="tc">{{item.sequence}}</td>
				<td class="tc">{{item.updateBy}}</td>
				<td class="tc">{{getDate(item.updateTime)|date:'yyyy-MM-dd HH:mm'}}</td>
				<td class="tc">
				<a class="f12 text-primary mr10 cursor" ng-if="showOperation('INTERFACE',$stateParams.moduleId)"
					ng-click="detail('编辑【'+item.interfaceName+'】',1100,'back/interface/detail.do?id='+item.id,'',initEditInterFace)"> 
					<i class="iconfont f12">&#xe618;修改</i>
				</a>
				<a class="f12 text-primary mr10 cursor" ng-if="showOperation('INTERFACE',$stateParams.moduleId)"
					ng-click="detail('拷贝【'+item.interfaceName+'】',600,'back/interface/detail.do?id='+item.id,'',copyInterface)"> 
					<i class="iconfont f12">&#xe61d;拷贝</i>
				</a>
				<a class="f12 text-primary mr10 cursor" ng-href="index.do#/{{item.projectId}}/front/interfaceDetail/{{item.id}}" target="_blank"> 
					<i class="iconfont f12">&#xe60a;预览</i>
				</a>
				<a class="f12 text-primary mr10 cursor" ng-href="index.do#/{{item.projectId}}/front/interface/debug/{{item.id}}" target="_blank">
					<i class="iconfont">&#xe625;&nbsp;</i>调试
				</a>
				<a class="f12 text-danger mr10 cursor" title="删除"  ng-if="showOperation('INTERFACE',$stateParams.moduleId)"
					ng-click="del('back/interface/delete.do?id='+item.id,item.interfaceName)">
					<i class="iconfont f12">&#xe60e;删除</i>
				</a>
				<div class="w50 fr tl">
					<a class="f12 text-danger mr10 cursor" title="向上移" ng-click="changeSequence('interface',item.id,list.interfaces[$index-1].id)" ng-if="$index>0">
						<i class="iconfont f12">&#xe623;</i>
					</a>
					<a class="f12 text-danger mr10 cursor" title="向下移" ng-click="changeSequence('interface',item.id,list.interfaces[$index+1].id)" ng-if="$index<list.interfaces.length-1">
						<i class="iconfont f12">&#xe624;</i>
					</a>
				</div>
				</td>
			</tr>

		</tbody>
	</table>
	<div ui-view="page"></div>
</div>
</div>
<div class="cb"></div>

